import React, { Component, } from 'react';
import { withRouter } from 'react-router-dom'

import { GhudaoCss } from '../style';

@withRouter
class Ghuddao extends Component {
    
    
    xiangqing(id) {
        this.props.history.push('/xiangqing/'+id);
    }
    render() {
        let list = this.props.guahudao
        return (
            <GhudaoCss>
                <img height='222px' src="https://pic.flyco.net.cn/mall/cms/home/shaversBg_FS901.png?x-oss-process=style/cms-images" alt="" />
                <div className='piso'>
                    {
                        list
                        ?
                        list.map(r => (
                            <div key={r.product.id} className='box' >
                                <div className='pic' onClick={e => this.xiangqing(r.product.productSn)}>
                                    <img className='sp_pic' src={r.product.picWap} alt="" />
                                </div>
                                <img onClick={()=>console.log(r,this.props.history.push)} className='Gwc' src="https://m.flyco.com//aliyun/images/home/cart.png" alt="" />
                                <div className='sp_name'>
                                    <p>{r.product.name}</p>
                                    <p className='price'> ￥{r.product.promotionPrice}</p>
                                </div>
                            </div>
                        ))
                        :
                        <div>666</div>
                    }
                    <div className='box'>
                        <div className='pic'  onClick={()=>console.log(this.props.history.push)} >
                            <img className='sp_pic' src='https://pic.flyco.net.cn/mall/cms/home/shavers/shavers_more.png' alt="" />
                        </div>
                    </div>
                </div>
            </GhudaoCss>
        );
    }
}

export default Ghuddao;
